import java.util.Scanner;

// BankAccount 类
class BankAccount {
    private int balance; // 账户余额

    // 无参构造方法，将余额初始化为 0
    public BankAccount() {
        this.balance = 0;
    }

    // 带参构造方法，将余额初始化为输入的参数
    public BankAccount(int balance) {
        this.balance = balance;
    }

    // 返回账户余额
    public int getBalance() {
        return balance;
    }

    // 提取款额
    public void withdraw(int amount) {
        balance -= amount;
    }

    // 存款
    public void deposit(int amount) {
        balance += amount;
    }
}

// Main 类
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 输入账户余额
        int initialBalance = scanner.nextInt();
        BankAccount account = new BankAccount(initialBalance);

        // 输出初始账户余额
        System.out.println(account.getBalance());

        // 输入提取额度
        int withdrawAmount = scanner.nextInt();
        account.withdraw(withdrawAmount);

        // 输出提取后的账户余额
        System.out.println(account.getBalance());

        // 输入存款额度
        int depositAmount = scanner.nextInt();
        account.deposit(depositAmount);

        // 输出存款后的账户余额
        System.out.println(account.getBalance());

        scanner.close();
    }
}
